package com.mz361.modules.system.repository;

import com.mz361.modules.system.domain.Company;
import org.springframework.data.jpa.repository.Query;

/**
 * @author liaomch
 * @ date 2024/05/07
 */
public interface CompanyRepository extends BaseRepository<Company, Long> {

    @Query(value = "select count(o.id) from Company o ")
    Long countAll();

    @Query(value = "select count(o.id) from Company o where o.sourceKey=?1")
    Long countBySourceKey(String sourceKey);

    @Query(value = "select count(o.id) from Company o where o.inviteCode=?1")
    Long countByInviteCode(String inviteCode);

    Company findByCompanyNum(String companyNum);
}